%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 0.000 0.000 550.000 550.000
%%EndComments

/MainFont /Helvetica findfont 8 scalefont def
MainFont setfont
%-----------------------------------------------------------------------
%
% utility procedures
%
%-----------------------------------------------------------------------
%
% procedure to produce a filled circle
%
/circle { % stack : x y size
%
%  store input data
%
   /size exch def
   /y    exch def
   /x    exch def
   gsave
   newpath
   x y moveto
   x size add y size 0 360 arc
   fill
   grestore
} def
%-----------------------------------------------------------------------
%
% procedure to draw the outline of the matrix
%
/draw_outline { % stack : xnw ynw dx dy nrow ncol
   /ncol exch def % number of columns
   /nrow exch def % number of rows
   /dy   exch def % column spacing
   /dx   exch def % row spacing
   /ynw  exch def % northwest y coordinate
   /xnw  exch def % northwest x coordinated
   /width  ncol 1 add dx mul def
   /height nrow 1 add dy mul def
   newpath
   xnw dx sub ynw dy add moveto 
   currentpoint width 0 rlineto
   0 height neg rlineto
   width neg 0 rlineto
   closepath
   stroke 
} def
%-----------------------------------------------------------------------
% procedure to draw matrix adjacency structure
%
/draw_matrix { % stack : xnw ynw dx dy adjncy 
%
%  store input data
%
   /adjncy exch def % adjacency structure
   /dy     exch def % column spacing
   /dx     exch def % row spacing
   /ynw    exch def % northwest y coordinate
   /xnw    exch def % northwest x coordinated
%
%  loop over the columns
%
   0 1 adjncy length 1 sub {
%
%     pop and store the column id and set the x coordinate
%
      /j exch def
      adjncy j get /column exch def 
      column 0 get /jcol exch def
      /xj xnw jcol dx mul add def
%
%     loop over the row entries
%
      0 1 column length 1 sub {
%
%        pop the row id, set the y coordinate and draw the tick
%
         /i exch def
         column i get /irow exch def
         xj ynw irow dy mul sub 1 circle
      } for
   } for
} def

%-----------------------------------------------------------------------
%
%  procedures to draw the supernode partition 
%
/draw_sn_overlay { % stack xnw ynw dx dy nrow ncol sninfo
%
%  store input data
%
   /sninfo exch def % supernode information
   /ncol   exch def % # of columns
   /nrow   exch def % # of rows
   /dy     exch def % column spacing
   /dx     exch def % row spacing
   /ynw    exch def % northwest y coordinate
   /xnw    exch def % northwest x coordinated
%
%  draw the left and bottom border
%
   0.1 dx mul setlinewidth
   newpath
   xnw dx 0.4 mul sub ynw dy 0.5 mul add moveto
   0 nrow dy mul neg rlineto
   ncol dx mul 0 rlineto
   stroke
%
%  loop over the columns
%
   0 1 sninfo length 1 sub {
%
%     pop and store the column id and set the x coordinate
%
      /J exch def
      sninfo J get /Jinfo exch def 
      Jinfo 0 get /vJ exch def
      Jinfo 1 get /nJ exch def
%
%     get location of first diagonal element
%
      /xj xnw vJ dx mul add def
      /yj ynw vJ dx mul sub def
%
      newpath
      xj dx 0.25 mul sub yj dx 0.5 mul add moveto
      nJ dx mul 0 rlineto     
      0 nJ dy mul neg rlineto     
      nJ dx mul neg 0 rlineto     
      nJ dx mul 0 rmoveto     
      0 nrow vJ nJ add sub dy mul neg rlineto
      stroke
   } for
} def
%-----------------------------------------------------------------------
%
/xnw  40 def
/ynw 510 def
/dx    4 def
/dy    4 def
%
%-----------------------------------------------------------------------
%
% factor matrix for R2D100
%
 /adjncyL [
 [ 0 1 2 6 7 ]
 [ 1 2 6 7 21 46 ]
 [ 2 6 7 21 44 46 ]
 [ 3 4 5 6 18 ]
 [ 4 5 6 7 18 20 ]
 [ 5 6 7 18 19 20 ]
 [ 6 7 18 19 20 21 44 46 ]
 [ 7 18 19 20 21 44 46 ]
 [ 8 11 17 91 ]
 [ 9 10 18 ]
 [ 10 11 18 19 ]
 [ 11 17 18 19 91 ]
 [ 12 13 20 21 45 ]
 [ 13 16 20 21 45 47 ]
 [ 14 15 16 17 47 99 ]
 [ 15 16 17 19 20 47 99 ]
 [ 16 17 19 20 21 45 47 99 ]
 [ 17 18 19 20 21 45 47 91 95 99 ]
 [ 18 19 20 21 44 45 46 47 91 95 99 ]
 [ 19 20 21 44 45 46 47 91 95 99 ]
 [ 20 21 44 45 46 47 91 95 99 ]
 [ 21 44 45 46 47 91 95 99 ]
 [ 22 27 41 90 ]
 [ 23 24 25 27 32 93 ]
 [ 24 25 26 27 31 32 93 ]
 [ 25 26 27 31 32 42 43 93 ]
 [ 26 27 31 32 42 43 45 46 93 ]
 [ 27 31 32 41 42 43 45 46 90 93 96 ]
 [ 28 29 30 31 45 47 ]
 [ 29 30 31 32 45 47 94 97 ]
 [ 30 31 32 45 47 92 94 97 98 ]
 [ 31 32 41 42 43 45 46 47 90 92 93 94 96 97 98 ]
 [ 32 41 42 43 45 46 47 90 92 93 94 96 97 98 ]
 [ 33 34 35 ]
 [ 34 35 36 38 ]
 [ 35 36 37 38 ]
 [ 36 37 38 39 40 ]
 [ 37 38 39 40 41 ]
 [ 38 39 40 41 44 ]
 [ 39 40 41 42 44 46 ]
 [ 40 41 42 43 44 46 ]
 [ 41 42 43 44 45 46 47 90 92 93 94 96 97 98 ]
 [ 42 43 44 45 46 47 90 92 93 94 96 97 98 ]
 [ 43 44 45 46 47 90 92 93 94 96 97 98 ]
 [ 44 45 46 47 90 91 92 93 94 95 96 97 98 99 ]
 [ 45 46 47 90 91 92 93 94 95 96 97 98 99 ]
 [ 46 47 90 91 92 93 94 95 96 97 98 99 ]
 [ 47 90 91 92 93 94 95 96 97 98 99 ]
 [ 48 49 53 ]
 [ 49 51 52 53 ]
 [ 50 51 55 69 ]
 [ 51 52 53 55 69 ]
 [ 52 53 55 69 70 ]
 [ 53 55 66 68 69 70 ]
 [ 54 55 67 69 91 95 ]
 [ 55 66 67 68 69 70 91 95 ]
 [ 56 57 58 59 87 ]
 [ 57 58 59 64 87 88 ]
 [ 58 59 64 65 87 88 ]
 [ 59 64 65 66 68 87 88 ]
 [ 60 62 63 67 69 92 99 ]
 [ 61 62 63 64 65 ]
 [ 62 63 64 65 67 69 70 92 99 ]
 [ 63 64 65 67 69 70 89 92 98 99 ]
 [ 64 65 66 67 68 69 70 87 88 89 92 98 99 ]
 [ 65 66 67 68 69 70 87 88 89 92 98 99 ]
 [ 66 67 68 69 70 87 88 89 91 92 95 98 99 ]
 [ 67 68 69 70 87 88 89 91 92 95 98 99 ]
 [ 68 69 70 87 88 89 91 92 95 98 99 ]
 [ 69 70 87 88 89 91 92 95 98 99 ]
 [ 70 87 88 89 91 92 95 98 99 ]
 [ 71 72 84 ]
 [ 72 74 84 85 ]
 [ 73 74 86 87 88 ]
 [ 74 84 85 86 87 88 ]
 [ 75 78 83 88 89 94 97 ]
 [ 76 77 78 82 83 85 ]
 [ 77 78 82 83 85 86 88 ]
 [ 78 82 83 85 86 88 89 94 97 ]
 [ 79 80 81 82 84 ]
 [ 80 81 82 84 90 96 ]
 [ 81 82 83 84 90 96 ]
 [ 82 83 84 85 86 88 89 90 94 96 97 ]
 [ 83 84 85 86 88 89 90 93 94 96 97 ]
 [ 84 85 86 87 88 89 90 93 94 96 97 ]
 [ 85 86 87 88 89 90 93 94 96 97 ]
 [ 86 87 88 89 90 93 94 96 97 ]
 [ 87 88 89 90 91 92 93 94 95 96 97 98 99 ]
 [ 88 89 90 91 92 93 94 95 96 97 98 99 ]
 [ 89 90 91 92 93 94 95 96 97 98 99 ]
 [ 90 91 92 93 94 95 96 97 98 99 ]
 [ 91 92 93 94 95 96 97 98 99 ]
 [ 92 93 94 95 96 97 98 99 ]
 [ 93 94 95 96 97 98 99 ]
 [ 94 95 96 97 98 99 ]
 [ 95 96 97 98 99 ]
 [ 96 97 98 99 ]
 [ 97 98 99 ]
 [ 98 99 ]
 [ 99 ]
 ] def
 /sn_info [
 [ 0 1 ]
 [ 1 1 ]
 [ 2 1 ]
 [ 3 1 ]
 [ 4 1 ]
 [ 5 1 ]
 [ 6 2 ]
 [ 8 1 ]
 [ 9 1 ]
 [ 10 1 ]
 [ 11 1 ]
 [ 12 1 ]
 [ 13 1 ]
 [ 14 1 ]
 [ 15 1 ]
 [ 16 1 ]
 [ 17 1 ]
 [ 18 4 ]
 [ 22 1 ]
 [ 23 1 ]
 [ 24 1 ]
 [ 25 1 ]
 [ 26 1 ]
 [ 27 1 ]
 [ 28 1 ]
 [ 29 1 ]
 [ 30 1 ]
 [ 31 2 ]
 [ 33 1 ]
 [ 34 1 ]
 [ 35 1 ]
 [ 36 1 ]
 [ 37 1 ]
 [ 38 1 ]
 [ 39 1 ]
 [ 40 1 ]
 [ 41 3 ]
 [ 44 4 ]
 [ 48 1 ]
 [ 49 1 ]
 [ 50 1 ]
 [ 51 1 ]
 [ 52 1 ]
 [ 53 1 ]
 [ 54 1 ]
 [ 55 1 ]
 [ 56 1 ]
 [ 57 1 ]
 [ 58 1 ]
 [ 59 1 ]
 [ 60 1 ]
 [ 61 1 ]
 [ 62 1 ]
 [ 63 1 ]
 [ 64 2 ]
 [ 66 5 ]
 [ 71 1 ]
 [ 72 1 ]
 [ 73 1 ]
 [ 74 1 ]
 [ 75 1 ]
 [ 76 1 ]
 [ 77 1 ]
 [ 78 1 ]
 [ 79 1 ]
 [ 80 1 ]
 [ 81 1 ]
 [ 82 1 ]
 [ 83 1 ]
 [ 84 3 ]
 [ 87 3 ]
 [ 90 10 ]
 ] def
%-----------------------------------------------------------------------
/nrow 100 def
/ncol 100 def

/row_ids [ 0  1  2  3  4  5  6  7  8  9
          10 11 12 13 14 15 16 17 18 19
          20 21 22 23 24 25 26 27 28 29
          30 31 32 33 34 35 36 37 38 39
          40 41 42 43 44 45 46 47 48] def

%-----------------------------------------------------------------------
%
% draw outline and gridlines
%
xnw ynw dx dy nrow ncol draw_outline
xnw ynw dx dy adjncyL draw_matrix
xnw ynw dx dy nrow ncol sn_info draw_sn_overlay
